SPI_WriteComm(0xFF);SPI_WriteData(0xFF);SPI_WriteData(0x98);SPI_WriteData(0x06);SPI_WriteData(0x04);SPI_WriteData(0x01);     // Change to Page 1

SPI_WriteComm(0x08);SPI_WriteData(0x10);                 // output SDA

SPI_WriteComm(0x21);SPI_WriteData(0x01);                 // DE = 1 Active

SPI_WriteComm(0x30);SPI_WriteData(0x01);                 // 480 X 854

SPI_WriteComm(0x31);SPI_WriteData(0x00);                 // Column Inversion

SPI_WriteComm(0x40);SPI_WriteData(0x18);                // BT

SPI_WriteComm(0x41);SPI_WriteData(0x44);                 // DVDDH DVDDL clamp

SPI_WriteComm(0x42);SPI_WriteData(0x03);                 // VGH/VGL


SPI_WriteComm(0x43);SPI_WriteData(0x09);                 // VGH_CLAMP 0FF ;

SPI_WriteComm(0x44);SPI_WriteData(0x07);                 // VGL_CLAMP OFF ;



SPI_WriteComm(0x50);SPI_WriteData(0x98);                   //VGMP

SPI_WriteComm(0x51);SPI_WriteData(0x98);                  //VGMN

SPI_WriteComm(0x52);SPI_WriteData(0x00);                   //Flicker

SPI_WriteComm(0x53);SPI_WriteData(0x53);                   //Flicker


SPI_WriteComm(0x57);SPI_WriteData(0x50);

SPI_WriteComm(0x60);SPI_WriteData(0x07);                 // SDTI

SPI_WriteComm(0x61);SPI_WriteData(0x00 );               // CRTI

SPI_WriteComm(0x62);SPI_WriteData(0x08);                 // EQTI

SPI_WriteComm(0x63);SPI_WriteData(0x00);                // PCTI

//++++++++++++++++++ Gamma Setting ++++++++++++++++++//


SPI_WriteComm(0xA0);SPI_WriteData(0x00);  // Gamma 0 	//255

SPI_WriteComm(0xA1);SPI_WriteData(0x0E);  // Gamma 4 	//251

SPI_WriteComm(0xA2);SPI_WriteData(0x17);  // Gamma 8	//247

SPI_WriteComm(0xA3);SPI_WriteData(0x0F);  // Gamma 16	//239

SPI_WriteComm(0xA4);SPI_WriteData(0x07);  // Gamma 24	//231

SPI_WriteComm(0xA5);SPI_WriteData(0x09);  // Gamma 52	//203

SPI_WriteComm(0xA6);SPI_WriteData(0x08);  // Gamma 80	//175

SPI_WriteComm(0xA7);SPI_WriteData(0x05); // Gamma 108	//147

SPI_WriteComm(0xA8);SPI_WriteData(0x08);  // Gamma 147	//108

SPI_WriteComm(0xA9);SPI_WriteData(0x0C);  // Gamma 175	//80

SPI_WriteComm(0xAA);SPI_WriteData(0x12);  // Gamma 203	//52

SPI_WriteComm(0xAB);SPI_WriteData(0x08);  // Gamma 231	//24

SPI_WriteComm(0xAC);SPI_WriteData(0x0F);  // Gamma 239	//16

SPI_WriteComm(0xAD);SPI_WriteData(0x15);  // Gamma 247	//8

SPI_WriteComm(0xAE);SPI_WriteData(0x0C);  // Gamma 251	//4

SPI_WriteComm(0xAF);SPI_WriteData(0x00);  // Gamma 255	//0

///==============Nagitive
SPI_WriteComm(0xC0);SPI_WriteData(0x00);  // Gamma 0

SPI_WriteComm(0xC1);SPI_WriteData(0x0E);  // Gamma 4

SPI_WriteComm(0xC2);SPI_WriteData(0x17);  // Gamma 8

SPI_WriteComm(0xC3);SPI_WriteData(0x0F);  // Gamma 16

SPI_WriteComm(0xC4);SPI_WriteData(0x07);  // Gamma 24

SPI_WriteComm(0xC5);SPI_WriteData(0x09);  // Gamma 52

SPI_WriteComm(0xC6);SPI_WriteData(0x08);  // Gamma 80

SPI_WriteComm(0xC7);SPI_WriteData(0x05);  // Gamma 108

SPI_WriteComm(0xC8);SPI_WriteData(0x08);  // Gamma 147

SPI_WriteComm(0xC9);SPI_WriteData(0x0C);  // Gamma 175

SPI_WriteComm(0xCA);SPI_WriteData(0x12);  // Gamma 203

SPI_WriteComm(0xCB);SPI_WriteData(0x07);  // Gamma 231

SPI_WriteComm(0xCC);SPI_WriteData(0x0F);  // Gamma 239

SPI_WriteComm(0xCD);SPI_WriteData(0x15);  // Gamma 247

SPI_WriteComm(0xCE);SPI_WriteData(0x0C);  // Gamma 251

SPI_WriteComm(0xCF);SPI_WriteData(0x00);  // Gamma 255



//+++++++++++++++++++++++++++++++++++++++++++++++++++//

//****************************************************************************//
//****************************** Page 6 Command ******************************//
//****************************************************************************//
SPI_WriteComm(0xFF);SPI_WriteData(0xFF);SPI_WriteData(0x98);SPI_WriteData(0x06);SPI_WriteData(0x04);SPI_WriteData(0x06 );     // Change to Page 6

SPI_WriteComm(0x00);SPI_WriteData(0x21);

SPI_WriteComm(0x01);SPI_WriteData(0x09);

SPI_WriteComm(0x02);SPI_WriteData(0x00 );

SPI_WriteComm(0x03);SPI_WriteData(0x00);

SPI_WriteComm(0x04);SPI_WriteData(0x01);

SPI_WriteComm(0x05);SPI_WriteData(0x01);

SPI_WriteComm(0x06);SPI_WriteData(0x80);

SPI_WriteComm(0x07);SPI_WriteData(0x05);

SPI_WriteComm(0x08);SPI_WriteData(0x02);

SPI_WriteComm(0x09);SPI_WriteData(0x80);

SPI_WriteComm(0x0A);SPI_WriteData(0x00 );

SPI_WriteComm(0x0B);SPI_WriteData(0x00);

SPI_WriteComm(0x0C);SPI_WriteData(0x0A);

SPI_WriteComm(0x0D);SPI_WriteData(0x0A);

SPI_WriteComm(0x0E);SPI_WriteData(0x00);

SPI_WriteComm(0x0F);SPI_WriteData(0x00);

SPI_WriteComm(0x10);SPI_WriteData(0xE0 );

SPI_WriteComm(0x11);SPI_WriteData(0xE4);

SPI_WriteComm(0x12);SPI_WriteData(0x04);

SPI_WriteComm(0x13);SPI_WriteData(0x00);

SPI_WriteComm(0x14);SPI_WriteData(0x00);

SPI_WriteComm(0x15);SPI_WriteData(0xC0);

SPI_WriteComm(0x16);SPI_WriteData(0x08);

SPI_WriteComm(0x17);SPI_WriteData(0x00);

SPI_WriteComm(0x18);SPI_WriteData(0x00);

SPI_WriteComm(0x19);SPI_WriteData(0x00);

SPI_WriteComm(0x1A);SPI_WriteData(0x00);

SPI_WriteComm(0x1B);SPI_WriteData(0x00);

SPI_WriteComm(0x1C);SPI_WriteData(0x00);

SPI_WriteComm(0x1D);SPI_WriteData(0x00);


SPI_WriteComm(0x20);SPI_WriteData(0x01);

SPI_WriteComm(0x21);SPI_WriteData(0x23);

SPI_WriteComm(0x22);SPI_WriteData(0x45);

SPI_WriteComm(0x23);SPI_WriteData(0x67);

SPI_WriteComm(0x24);SPI_WriteData(0x01);

SPI_WriteComm(0x25);SPI_WriteData(0x23);

SPI_WriteComm(0x26);SPI_WriteData(0x45);

SPI_WriteComm(0x27);SPI_WriteData(0x67);


SPI_WriteComm(0x30);SPI_WriteData(0x01);

SPI_WriteComm(0x31);SPI_WriteData(0x11);

SPI_WriteComm(0x32);SPI_WriteData(0x00);

SPI_WriteComm(0x33);SPI_WriteData(0xEE);

SPI_WriteComm(0x34);SPI_WriteData(0xFF);

SPI_WriteComm(0x35);SPI_WriteData(0xBB);

SPI_WriteComm(0x36);SPI_WriteData(0xCA);

SPI_WriteComm(0x37);SPI_WriteData(0xDD);

SPI_WriteComm(0x38);SPI_WriteData(0xAC);

SPI_WriteComm(0x39);SPI_WriteData(0x76);

SPI_WriteComm(0x3A);SPI_WriteData(0x67);

SPI_WriteComm(0x3B);SPI_WriteData(0x22);

SPI_WriteComm(0x3C);SPI_WriteData(0x22);

SPI_WriteComm(0x3D);SPI_WriteData(0x22);

SPI_WriteComm(0x3E);SPI_WriteData(0x22);

SPI_WriteComm(0x3F);SPI_WriteData(0x22);

SPI_WriteComm(0x40);SPI_WriteData(0x22);


SPI_WriteComm(0x52);SPI_WriteData(0x10);

SPI_WriteComm(0x53);SPI_WriteData(0x10);


//****************************************************************************//
//****************************** Page 7 Command ******************************//
//****************************************************************************//
SPI_WriteComm(0xFF);SPI_WriteData(0xFF);SPI_WriteData(0x98);SPI_WriteData(0x06);SPI_WriteData(0x04);SPI_WriteData(0x07 );     // Change to Page 7


SPI_WriteComm(0x06);SPI_WriteData(0x11); //

SPI_WriteComm(0x17);SPI_WriteData(0x22 ); //

SPI_WriteComm(0x02);SPI_WriteData(0x77);  //

SPI_WriteComm(0xE1);SPI_WriteData(0x79); //

//****************************************************************************//

SPI_WriteComm(0xFF);SPI_WriteData(0xFF);SPI_WriteData(0x98);SPI_WriteData(0x06);SPI_WriteData(0x04);SPI_WriteData(0x00 );    // Change to Page 0
SPI_WriteComm(0x3a);SPI_WriteData(0x55);
//Exit Sleep
SPI_WriteComm(0x11);
Delay(120);
//Display On
SPI_WriteComm(0x29);
Delay(10);